package com.cnhis.cloudhealth.clinical.clidoctor.commentquery.bo;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cnhis.cloudhealth.clinical.clidoctor.commentquery.dao.CommentQueryDao;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;
import com.cnhis.cloudhealth.commons.utils.Page;
import com.cnhis.cloudhealth.commons.utils.StaticKeys;

@Service
public class CommentQueryBo {
	@Resource
	private CommentQueryDao commentQueryDao;
	
	public ModelVo doctorPrescriptionCommentQuery(Map map,int currPage,int pageSize)throws Exception{
		ModelVo mo = new ModelVo();
		Page pg = null;
		try {
			pg =commentQueryDao.doctorPrescriptionCommentQuery(map, currPage, pageSize);
		} catch (Exception e) {
			e.printStackTrace();
			mo.setResult(StaticKeys.OH_FALSE);
			return mo;
		}
		
		mo.setList(pg.getList());
		mo.setResult(StaticKeys.OH_SUCCESS);
		mo.setTotal(pg.getTotalNumber());
		mo.setRows(pg.getList());
		return mo;
	}
}
